package com.keyin.protocol;

import com.keyin.android.net.Param;

import android.content.Context;

public class ProtocolHelper {

	public static Protocol getMagazineList(Context context) {
		final String URL = "http://www.keyin.cn/ipad/magazines_list.php";
		Protocol pro = new Protocol(context, URL, new Param());
		return pro;
	}

	public static Protocol getNewMagazines(Context context) {
		final String URL = "http://www.keyin.cn/ipad/new_magazines.php";
		return new Protocol(context, URL, new Param());
	}

	public static Protocol getPeriodical(Context context, String periodicalId,
			int page) {
		final String URL = "http://www.keyin.cn/ipad/get_magazine.php?";

		Param p = new Param();
		p.append("periodical_id", periodicalId);
		p.append("page", String.valueOf(page));

		return new Protocol(context, URL.concat(p.toString()), new Param());
	}

	public static Protocol getPastPeriodicals(Context context, String magazineId,
			int page, int pageSize) {
		final String URL = "http://www.keyin.cn/ipad/get_magazines_list.php?";

		Param p = new Param();
		p.append("magazine_id", magazineId);
		p.append("page_index", String.valueOf(page));
		p.append("page_size", String.valueOf(pageSize));

		return new Protocol(context, URL.concat(p.toString()), new Param());
	}
}
